﻿/**************************************************************
* Copyright (C) 2022 www.eipflow.com 孙泽伟版权所有(盗版必究)
*
* 作者: 孙泽伟(QQ 1039318332)
* 创建时间: 2022/01/12 22:40:15
* 文件名: 
* 描述: 
* 
* 修改历史
* 修改人：
* 时间：
* 修改说明：
*
**************************************************************/

namespace EIP.System.Controller
{
    /// <summary>
    /// 每个列表用户自定义顺序宽度冻结
    /// </summary>
    public class ZeroCodeGridCustomController : BaseSystemController
    {
        #region 构造函数
        private readonly ISystemZeroCodeGridCustomLogic _systemZeroCodeGridCustomLogic;
        /// <summary>
        /// 
        /// </summary>
        public ZeroCodeGridCustomController(
            ISystemZeroCodeGridCustomLogic systemZeroCodeGridCustomLogic
            )
        {
            _systemZeroCodeGridCustomLogic = systemZeroCodeGridCustomLogic;
        }

        #endregion

        /// <summary>
        /// 分页获取
        /// </summary>
        /// <param name="paging">分页参数</param>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("每个列表用户自定义顺序宽度冻结-方法-列表-根据父级查询所有子集", RemarkFrom.System)]
        [Route("/system/zerocode/grid/custom/list")]
        public async Task<ActionResult> Find(SystemZeroCodeGridCustomFindInput paging)
        {
            return JsonForGridPaging(await _systemZeroCodeGridCustomLogic.Find(paging));
        }

        /// <summary>
        /// 根据Id获取
        /// </summary>
        /// <param name="input">主键信息</param>
        /// <returns></returns>
        [HttpGet]
        [CreateBy("孙泽伟")]
        [Remark("每个列表用户自定义顺序宽度冻结-方法-编辑-根据Id获取", RemarkFrom.System)]
        [Route("/system/zerocode/grid/custom/{id}")]
        public async Task<ActionResult> FindById([FromRoute] IdInput input)
        {
            return Ok(await _systemZeroCodeGridCustomLogic.FindById(input));
        }

        /// <summary>
        /// 根据Key获取
        /// </summary>
        /// <param name="input">主键信息</param>
        /// <returns></returns>
        [HttpGet]
        [CreateBy("孙泽伟")]
        [Remark("每个列表用户自定义顺序宽度冻结-方法-编辑-根据Key获取", RemarkFrom.System)]
        [Route("/system/zerocode/grid/custom/key/{id}")]
        public async Task<ActionResult> FindByKey([FromRoute] IdInput<string> input)
        {
            return Ok(await _systemZeroCodeGridCustomLogic.FindByKey(input));
        }

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="input">主键信息</param>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("每个列表用户自定义顺序宽度冻结-方法-编辑-保存", RemarkFrom.System)]
        [Route("/system/zerocode/grid/custom")]
        public async Task<ActionResult> Save(SystemZeroCodeGridCustom input)
        {
            return Ok(await _systemZeroCodeGridCustomLogic.Save(input));
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input">主键集合</param>
        /// <returns></returns>
        [HttpPost]
        [CreateBy("孙泽伟")]
        [Remark("每个列表用户自定义顺序宽度冻结-方法-列表-删除", RemarkFrom.System)]
        [Route("/system/zerocode/grid/custom/delete")]
        public async Task<ActionResult> Delete(IdInput<string> input)
        {
            return Ok(await _systemZeroCodeGridCustomLogic.Delete(input));
        }

    }
}